package com.lonely.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lonely.order.domain.dto.secondprocess.QueryOrderSecondProcessPageQueryDTO;
import com.lonely.order.domain.dto.secondprocess.SecondProcessStatusQuantityTotal;
import com.lonely.order.domain.entity.SysOrderSecondProcess;
import com.lonely.order.domain.vo.secondprocess.QueryOrderSecondProcessPageQueryVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author : 黄志标
 * @date: 2025/7/2 10:44
 * @description: 订单二次工艺mapper
 */
public interface SysOrderSecondProcessMapper extends BaseMapper<SysOrderSecondProcess> {

    /**
     * 根据订单id物理删除对应的二次工艺
     *
     * @param orderId
     */
    void physicalDeletionByOrderId(@Param("orderId") Long orderId);

    /**
     * 二次工艺分页查询
     *
     * @param page
     * @param queryDto
     * @return
     */
    Page<QueryOrderSecondProcessPageQueryVO> page(Page<QueryOrderSecondProcessPageQueryVO> page, @Param("query") QueryOrderSecondProcessPageQueryDTO queryDto);

    /**
     * 获取二次工艺状态总数
     *
     * @param queryDto
     * @return
     */
    List<SecondProcessStatusQuantityTotal> getStatusTotals(@Param("query") QueryOrderSecondProcessPageQueryDTO queryDto, @Param("dataPermissions") String dataPermissions);
}
